home *** CD-ROM | disk | FTP | other *** search
- Path: castle.nando.net!news
- From: actuary@nando.net (Bill McCarthy)
- Newsgroups: comp.lang.c
- Subject: Re: ***NEED HELP WITH CALCULATION FUNCTION*** ASAP
- Date: 18 Mar 1996 19:26:32 GMT
- Organization: Nando.net Public Access
- Message-ID: <4ikdd8$q1i@castle.nando.net>
- References: <4i0mva$j0c@fountain.mindlink.net> <4if39b$d2h@castle.nando.net> <DoGEE5.12B@matt.fidalgo.net>
- Reply-To: actuary@nando.net (Bill McCarthy)
- NNTP-Posting-Host: grail2116.nando.net
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <DoGEE5.12B@matt.fidalgo.net>, matt@matt.fidalgo.net (Matt Gischer) writes:
- >Bill McCarthy (actuary@nando.net) wrote:
- >: >The user is allowed to enter the annual rate of interest either as a
- >: >percentage eg. 15 or enter as a decimal eg. .15. If the user enters the
- >: >annual rate of interest as a percentage eg. 15, then divide by 100
- >: >before using it in the formula.
- >: >
- >: >Any ideas how I could code this test?
- >:
- >: Your description doesn't make any sense. One user may type 15
- >: meaning 15%, another might intend 1500%. Likewise .15 may be
- >: a fractional representation of 15% of a percentage representation
- >: of 15 basis points.
- >:
- >: BTW, does any of this have anything to do with C?
- >
- >It makes a lot of _sense_. It could be done easily with an if.
- >if(p>1) p=p/100; would be simple enough.
-
- Thanks for correcting my spelling typo. You're missing the point. Try
- concentrating on the logic, not the spelling. The original poster did
- not specify that input >1 should be interpreted as a percentage, and
- input <=1 should be interpreted as a fraction. In fact, if he entered 1
- thinking 1%, he may be surprised to find out the program used 100%.
-
- Bill McCarthy
- actuary@nando.net
- Wendell, NC USA
-
-